package com.example.jd.common;

import org.apache.commons.lang3.time.DateFormatUtils;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Date;

/**
 * todo
 *
 * @author daolai.fu
 * @description
 * @date 2021/11/8 16:59
 */
public class DateUtils {
    public static final String SF13 = "yyyyMMddHHmm";
    /**
     * String转LocalDate
     */
    public static LocalDateTime stringToLocalDate(String str) {
        return LocalDateTime.parse(str, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
    }

    public static String getMinString() {
        String nows = "000000000000";
        try {
            Date now = new Date();
            nows = DateFormatUtils.format(now, SF13);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return nows;
    }
}
